<div class="mb-xs">
    <i class="glyphicon glyphicon-user"></i>
    by <user-info value="value.createdBy" field="name"></user-info>

    <i class="glyphicon glyphicon-calendar ml-xxs"></i>
    Occurred on <span ng-bind="value.startDate | shortDate"> </span>
</div>

<div ng-switch="value.objectType">
    <div ng-switch-when="user">
        <div class="search-item-title">
            <a href>
            {{value.operation}} of {{value.objectType}} <br>
            <em class="text-muted"><span>{{value.stats.name}}</span></em>
            </a>
        </div>
    </div>
    <div ng-switch-when="case" ui-sref="app.case.details({caseId: value.objectId})">
        <div class="search-item-title">
            <a href>
            {{value.operation}} of {{value.objectType}} <br>
            <em class="text-muted"><span>{{value.stats.title || value.details.title}}</span></em>
            </a>
        </div>
        <div>
            <i class="glyphicon glyphicon-user"></i>
            <user-info value="value.stats.owner" field="name"></user-info>

            <i class="glyphicon glyphicon-calendar ml-xxs"></i>
            <span ng-bind="value.stats.startDate | shortDate"></span>

            <span ng-if="value.stats.endDate" class="text-success">
                (
                <strong>Closed</strong>
                on
                {{value.stats.endDate | shortDate}}
                as
                <strong>{{value.stats.resolutionStatus}}</strong>)
            </span>
        </div>
    </div>
    <div ng-switch-when="case_task">
        <div class="search-item-title">
            <a href>
            {{value.operation}} of task <br>
            <em class="text-muted"><span>{{value.stats.title || value.details.title}}</span></em>
            </a>
        </div>
    </div>
    <div ng-switch-when="case_task_log">
        <div class="search-item-title">
            <a href>
            {{value.operation}} of task log
            </a>
        </div>
    </div>
    <div ng-switch-when="case_artifact" ui-sref="app.case.observables-item({caseId: value.stats.case.id, itemId: value.stats.id})">
        <div class="search-item-title">
            <a href>
            {{value.operation}} of observable <br>
            <em class="text-muted"><span>{{value.stats.data}}</span></em>
            </a>
        </div>
    </div>
    <div ng-switch-when="case_artifact_job">
        <div class="search-item-title">
            <a href>
            {{value.operation}} of observable job <br>
            <em class="text-muted"><span>{{value.stats.analyzerName}}</span></em>
            </a>
        </div>
    </div>
    <div ng-switch-when="alert">
        <div class="search-item-title">
            <a href>
            {{value.operation}} of alert<br>
            <em class="text-muted"><span>{{value.stats.title}}</span></em>
            </a>
        </div>
        <div>
            <span>
                <i class="fa fa-calendar"></i> Date:
                <strong class="text-muted">{{value.stats.date | shortDate}}</strong>
            </span>
            <span class="ml-xxs">
                <i class="fa fa-certificate"></i> Type:
                <strong class="text-muted">{{value.stats.type}}</strong>
            </span>
            <span class="ml-xxs">
                <i class="fa fa-barcode"></i> Reference:
                <strong class="text-muted">{{value.stats.sourceRef}}</strong>
            </span>
            <span class="ml-xxs">
                <i class="fa fa-bullseye"></i> Source:
                <strong class="text-muted">{{value.stats.source}}</strong>
            </span>
        </div>
    </div>
</div>
<div class="mt-xs wrap">
    <strong>Details (<a href ng-show="!value.show" ng-click="value.show = true">Expand</a><a href ng-show="value.show" ng-click="value.show = false">Collapse</a>)</strong>
    <pre ng-show="value.show">{{value.details | flattern | json}}</pre>
</div>
